package com.ericom.model;

import java.io.Serializable;

import javax.persistence.Embeddable;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

@Embeddable
public class Amount extends BaseObject implements Serializable {

	private static final long serialVersionUID = 1L;

	private float avalue;
	private String currency;
	@Override
	public String toString() {
		return new ToStringBuilder(this).append("avalue", avalue)
				.append("currency", currency).toString();
	}
	@Override
	public boolean equals(final Object other) {
		if (!(other instanceof Amount))
			return false;
		Amount castOther = (Amount) other;
		return new EqualsBuilder().append(avalue, castOther.avalue)
				.append(currency, castOther.currency).isEquals();
	}
	@Override
	public int hashCode() {
		return new HashCodeBuilder().append(avalue).append(currency)
				.toHashCode();
	}
	public float getAvalue() {
		return avalue;
	}
	public void setAvalue(float avalue) {
		this.avalue = avalue;
	}
	public String getCurrency() {
		return currency;
	}
	public void setCurrency(String currency) {
		this.currency = currency;
	}
	
	
	
	

}
